import request from '@/utils/request'

// 用户状态修改
export function changeMyStatus(state) {
	return request({
		'url': '/activity/activityUser/myUpdateStates?state='+state,
		'method': 'get',
	})
}

// 获取我的活动数据
export function getActivity(userId, activityState, pageNum, pageSize) {
	const data = {
		userId,
		activityState,
		pageNum,
		pageSize
	}
	return request({
		'url': '/activity/activityApplication/list1',
		'method': 'get',
		data
	})
}
//活动类型
export function activitytype() {
	return request({
		'url': '/activity/activityType/classify',
		'method': 'get',
	})
}
// 取消报名
export function cancelActivity(userId, activityId) {
	const data = {
		userId,
		activityId
	}

	return request({
		'url': '/activity/activityApplication/noApplication',
		'method': 'get',
		data
	})
}


// 我的活动删除记录
export function deleteActivityRecord(data) {
	return request({
		'url': '/activity/activityApplication/delete',
		'method': 'get',
		data
	})
}


// 退款
export function refund(userId, activityId) {
	const data = {
		userId,
		activityId
	}
	return request({
		'url': '/activity/activityPay/wechatRefund',
		'method': 'post',
		data
	})
}

// 我的列表退款
export function refundList(data) {
	return request({
		'url': '/activity/activityPay/refundList',
		'method': 'get',
		data
	})
}
//退款记录删除
export function Delrefund(data) {
	return request({
		'url': '/activity/activityPay/deleteRefundList',
		'method': 'get',
		data
	})
}

// 获取我的发布的数据
export function getPublish(data) {
	// const data = {
	// 	userId, 
	// 	activityStatus,
	// 	pageNum,
	// 	pageSize,
	//        spType
	// }
	return request({
		'url': '/activity/activityInfo/myPublishing',
		'method': 'get',
		data
	})
}

// 我的发布删除活动
export function deleteActivity(data) {
	console.log(data, '删除');
	return request({
		'url': `/activity/activityInfo/delete/${data.activityId}`,
		'method': 'DELETE'
	})
}

// 新增空闲时间
export function addFreeTime(data) {
	return request({
		'url': `/activity/activityLeisure`,
		'method': 'post',
		data
	})
}

// 获取存储的空闲时间
export function getFreeTime(data) {
	return request({
		'url': `/activity/activityLeisure/${data.userId}`,
		'method': 'get'
	})
}
// 	获取活动收藏列表数据
export function getCollectionList(data) {
	return request({
		'url': '/activity/collection/myCollection',
		'method': 'get',
		data
	})
}

// 	删除活动收藏数据
export function removeCollection(data) {
	return request({
		'url': `/activity/collection/removeCollection`,
		'method': 'get',
		data
	})
}

//获取活动收藏分类列表数据
export function getCollectType() {
	return request({
		'url': '/activity/activityType/classify',
		'method': 'get'
	})
}

//获取消息中心官方通知数据列表
export function getOfficialMsgList() {
	return request({
		'url': '/activity/activityMessage/list2',
		'method': 'get',
		data: {
			typeId: 1
		}
	})
}
//获取消息中心互动消息数据列表
export function getInteractMsgList(data) {
	return request({
		'url': '/activity/activityMessage/mutual',
		'method': 'get',
		data
	})
}
//获取消息中心服务消息数据列表
export function getServiceMsgMsgList(data) {
	return request({
		'url': '/activity/activityRefundMessage/list1',
		'method': 'get',
		data
	})
}
//获取消息中心社团消息数据列表
export function getClubMsgList(data) {
	return request({
		'url': '/activity/members/list6',
		'method': 'get',
		data
	})
}
//获取用户信息
export function getUserInfo(userid) {
	return request({
		'url': `/activity/user/${userid}`,
		'method': 'get',
	})
}
//上传图片
export function reqUploadImage(tempFilePaths) {
	return request({
		'url': '/activity/activityFiles/uploadFiles',
		'method': 'post',
		headers: {
			isToken: true
		},
		name: "imageFile",
		filePath: []
	})
}

// 删除活动图片
export function reqDeleteActivityImage(imgUrl) {
	return request({
		'url': '/activity/activityFiles/deleteFiles',
		'method': 'delete',
		'params': {
			"deleteFiles": imgUrl
		}
	})
}
//活动发布
export function reqActivityInfo(data) {
	return request({
		'url': '/activity/activityInfo/releaseActivity',
		'method': 'post',
		'data': data,
	})
}

//活动修改
export function updateActivityInfo(data) {
	return request({
		'url': '/activity/activityInfo/editActivity',
		'method': 'Post',
		'data': data,
	})
}
//活动排行榜
export function activityLeaderboard() {
	return request({
		'url': '/activity/activityHome/getHotList',
		'method': 'get',
	})
}

export function activation() {
	return request({
		'url': '/activity/activityHome/getIntegralList',
		'method': 'get',
	})
}
//提交兴趣
export function reqInterest(data) {
	return request({
		'url': '/activity/activityUser/interest?userId=' + data.userId,
		'method': 'post',
		headers: {
			isToken: true
		},
		data: data.array,
	})
}

//获取审核列表
export function getexamine(data) {
	return request({
		'url': '/activity/activityInfo/examineList',
		'method': 'get',
		'data': data,
	})
}
//获取已审核表
export function Audited(data) {
	return request({
		'url': '/activity/activityInfo/auditedList',
		'method': 'get',
		'data': data,
	})
}

//提交审核内容
export function postexamine(data) {
	return request({
		'url': '/activity/activityInfo/examineActivity',
		'method': 'put',
		data:data
	})
}
//查询空闲时间
export function getidle(data) {
	return request({
		'url': '/activity/activityLeisure/proportion',
		'method': 'get',
		data:data
	})
}
//排行榜
export function getActivation(data) {
	return request({
		'url': '/activity/activityHome/getIntegralList',
		'method': 'get',
		data:data
	})
}
//获取社团认证列表
export function getmass(data) {
	return request({
		'url': '/activity/sgs/audit',
		'method': 'get',
		'data': data,
	})
}
// 获取社团详情
export function getCommunityInformation(data) {
	return request({
		'url': '/activity/sgs/details',
		'method': 'get',
		'data': data,
	})
}

export function postauditStatus(data) {
	return request({
		'url': '/activity/sgs/auditStatus',
		'method': 'post',
		'data': data,
	})
}

export function getauditStatus(data) {
	return request({
		'url': '/activity/sgs/audit',
		'method': 'get',
		'data': data,
	})
}